Scanline algorithm